{% extends"base.html" %}
{% block title %}新增用户{% endblock %}

{% block main %}
    <form class="form-signin" action="{{ url_for('admin.add_user') }}" method=POST>
        <h2 class="form-signin-heading">新增用户</h2>
        {{ input("username","inputEmail","form-control first","请输入用户名","text") }}
        {{ input("password","inputPassword","form-control mid","请输入密码","password") }}
        {{ input("repassword","inputRePassword","form-control last","请输入密码","password") }}
        <button class="btn btn-lg btn-primary btn-block" type="submit">新增</button>
    </form>
{% endblock %}

{%- macro input(name,id,class="",placeholder="",type="text",value="")-%}
    <label for="{{ id }}" class="sr-only">{{ id }}</label>
    <input type="{{ type }}" id="{{ id }}" name="{{ name }}" class="{{ class }}" placeholder="{{ placeholder }}"
           value="{{ value }}" required>
{%- endmacro -%}